package analysis;

import common.AnalysisWare;
import common.Constants;
import common.DataAnalysis;
import util.FileUtil;
import util.mysql.MysqlUtil;
import util.remote.RemoteConnectResult;
import util.remote.RemoteType;

/**
 * Created by J.Chen on 2017/5/27.
 */

@AnalysisWare(confCode = "ACT_2017_04_KGE_TALENT", desc = "K歌达人", remote = RemoteType.wan360)
public class KgeTalentAnalysis extends DataAnalysis {
    public KgeTalentAnalysis(RemoteConnectResult result, String confCode) {
        super(result, confCode);
    }

    @Override
    public void execute() {
        String sql = MysqlUtil.getBusinessLogSql("step,count(1) `num`", "d1", actConf, "drawAwards", 1, null, null, null);
        FileUtil fileUtil = new FileUtil(Constants.getActOutputDir(result.getRemoteConf(), actConf.getConfCode(), actConf.getTimeStartStr()));
        fileUtil.writeMysqlList(result.getMysqlUtil().selectList(sql), "|", "step", "num");
        fileUtil.close();
    }
}
